﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="MontarServicoConsulta.aspx.cs" Inherits="NewTierra.Pages.MontarServicos.MontarServicoConsulta" %>

<!DOCTYPE html>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit.HTMLEditor" TagPrefix="cc1" %>

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title></title>

    <link rel="shortcut icon" href="../../images/Icones/favicon.ico" type="image/x-icon" />

    <link href="../../Styles/jquery_notification.css" rel="stylesheet" />

    <link href="../../Styles/jquery-ui.css" rel="stylesheet" />    
    <script type="text/javascript" src="../../Scripts/jquery-1.11.0.js"></script>
    <script type="text/javascript" src="../../Scripts/jquery-ui-1.10.0.js"></script>

    <script type="text/javascript" src="../../Scripts/jquery_notification_v.1.js"></script>

    <link href="~/Styles/EstiloGeral.css" rel="stylesheet" type="text/css" />

    <style type="text/css">
        #MServico
        {
            height: 662px;
            width: 1330px;
            margin-top: 20px;
            margin-left: 5px;
            margin-right: 5px;
        }

        .MServicoFormEsq
        {
            width: 401px;
            float: left;
            height: 401px;
        }

        .MServicoFormDir
        {
            height: 518px;
            float: left;
            width: 850px;
            margin-left: 20px;
        }

        .MServicoFormularioCrud
        {
            height: 341px;
            padding: 5px;
            float: left;
            border: 1px solid #E6E6E6;
            background: #FAFAFA;
            color: #666;
            margin-top: 0px;
            width: 375px;
        }

        .BotoesMServico
        {
            height: 40px;
        }

        .MServCadastro
        {
            height: 253px;
        }

        .FormTransporte
        {
            height: 42px;
        }

            .FormTransporte .FormTransporte_tipo
            {
                width: 368px;
                float: left;
            }

        #SetMServico
        {
            height: 370px;
        }

        .FromDatas
        {
            height: 49px;
        }

            .FromDatas .dataFrom
            {
                width: 129px;
                float: left;
            }

            .FromDatas .dataTo
            {
                width: 129px;
                float: left;
            }

        .FormTipoServico
        {
            height: 92px;
        }

            .FormTipoServico .FormTipoServico_categoria
            {
                height: 41px;
                float: left;
                width: 361px;
            }

            .FormTipoServico .FormTipoServico_tiposervico
            {
                height: 44px;
                float: left;
                width: 363px;
            }

        .FormMoeda_Obs
        {
            height: 75px;
        }

            .FormMoeda_Obs .FormMoeda_Obs_moeda
            {
                width: 82px;
                float: left;
            }

            .FormMoeda_Obs .FormMoeda_Obs_obs
            {
                width: 365px;
                float: left;
                height: 53px;
            }

        .GridMServico
        {
            margin-top: 5px;
            padding-top: 10px;
            height: 360px;
            width: 926px;
            overflow: auto;
        }

        .DatalistBody
        {
            height: 66px;
        }

            .DatalistBody .HeaderDataList
            {
                height: 29px;
                float: left;
                width: 610px;
            }

            .DatalistBody .BodyDatalist
            {
                height: 16px;
                float: left;
                width: 605px;
            }

        .GridMServico_Filtro
        {
            padding: 10px;
            height: 193px;
        }

        .bases_filtros
        {
            width: 815px;
            height: 184px;
        }

            .bases_filtros .bases_filtros_drops
            {
                float: left;
                width: 150px;
                height: 51px;
            }

        .DataListBases
        {
            height: 259px;
            padding: 5px;
            display: inline;
            float: left;
            position: relative;
            border: 1px solid #E6E6E6;
            background: #FAFAFA;
            color: #666;
            margin-top: 0px;
            width: 816px;
            overflow-y: auto;
            overflow-x: hidden;
            top: 0px;
            left: 0px;
        }

        .DataListBasesInto
        {
            overflow-y: auto;
            height: 211px;
            width: 816px;
        }

        .bases_filtros_box
        {
            width: 801px;
            float: left;
            height: 40px;
            margin-top: 9px;
        }

        .bases_filtros_box_dividir
        {
            width: 484px;
            float: left;
            height: 65px;
            margin-top: 0px;
            border: 1px solid #E6E6E6;
            background: #FAFAFA;
            padding: 5px;
        }

        .bases_filtros_drops_dividir
        {
            float: left;
            width: 119px;
            height: 40px;
        }

        .forms
        {
            height: 543px;
        }

        .FiltrosMServicos
        {
            float: left;
            height: 123px;
            margin-top: 0px;
            border: 1px solid #E6E6E6;
            background: #FAFAFA;
            padding: 5px;
            width: 444px;
        }

        .ModalPopupBG
        {
            background-color: gray;
            filter: alpha(opacity=60);
            opacity: 0.7;
        }

        .ModalPopup
        {
            border: 1px solid #E6E6E6;
            background-color: #fff;
            padding: 3px;
        }
    </style>


</head>

<body>
    <form id="formulario" runat="server">

        <script type="text/javascript">

            jQuery(function ($) {
                $.datepicker.regional['pt-BR'] = {
                    closeText: 'Fechar',
                    prevText: '&#x3c;Anterior',
                    nextText: 'Pr&oacute;ximo&#x3e;',
                    currentText: 'Hoje',
                    monthNames: ['Janeiro', 'Fevereiro', 'Mar&ccedil;o', 'Abril', 'Maio', 'Junho',
                 'Julho', 'Agosto', 'Setembro', 'Outubro', 'Novembro', 'Dezembro'],
                    monthNamesShort: ['Jan', 'Fev', 'Mar', 'Abr', 'Mai', 'Jun',
                 'Jul', 'Ago', 'Set', 'Out', 'Nov', 'Dez'],
                    dayNames: ['Domingo', 'Segunda-feira', 'Ter&ccedil;a-feira', 'Quarta-feira', 'Quinta-feira', 'Sexta-feira', 'Sabado'],
                    dayNamesShort: ['Dom', 'Seg', 'Ter', 'Qua', 'Qui', 'Sex', 'Sab'],
                    dayNamesMin: ['Dom', 'Seg', 'Ter', 'Qua', 'Qui', 'Sex', 'Sab'],
                    weekHeader: 'Sm',
                    dateFormat: 'dd/mm/yy',
                    firstDay: 0,
                    isRTL: false,
                    showMonthAfterYear: false,
                    yearSuffix: ''
                };
                $.datepicker.setDefaults($.datepicker.regional['pt-BR']);

                $("#tabs").tabs();
            });

            function jScript() {
                $("input[id$=from]").datepicker({
                    defaultDate: "+1w",
                    changeMonth: true,
                    changeYear: true,
                    numberOfMonths: 1,
                    onClose: function (selectedDate) {
                        $("input[id$=to]").datepicker("option", "minDate", selectedDate);
                    }
                });
                $("input[id$=to]").datepicker({
                    defaultDate: "+1w",
                    changeMonth: true,
                    changeYear: true,
                    numberOfMonths: 1,
                    onClose: function (selectedDate) {
                        $("input[id$=from]").datepicker("option", "maxDate", selectedDate);
                    }
                });

                $("input[id$=txtFiltroMServicosDataFrom]").datepicker({
                    defaultDate: "+1w",
                    changeMonth: true,
                    changeYear: true,
                    numberOfMonths: 1,
                    onClose: function (selectedDate) {
                        $("input[id$=txtFiltroMServicosDataTo]").datepicker("option", "minDate", selectedDate);
                    }
                });
                $("input[id$=txtFiltroMServicosDataTo]").datepicker({
                    defaultDate: "+1w",
                    changeMonth: true,
                    changeYear: true,
                    numberOfMonths: 1,
                    onClose: function (selectedDate) {
                        $("input[id$=txtFiltroMServicosDataFrom]").datepicker("option", "maxDate", selectedDate);
                    }
                });


                $("input[id*='txtValoresBases']").change(function (event) {                                        

                    if ($('#chkPercentValorSS').is(':checked')) {             

                        var val1 = parseInt($(this).parent().find("input[id*='txtValoresBases']").val(), 10);
                        var val2 = parseInt($('#txtValorAdicional').val(), 10);
                        var soma = val1 + val2;
                        var Percent = parseInt($('#txtPercentValorAdicional').val(), 10);

                        if (Percent == 0) {

                            var num = soma.toString().replace(".", ",");

                            var result = $(this).parent().find("input[id*='txtValoresBases']").val(num);                            
                        }
                        else {

                            var percentAd = ((soma * Percent) / 100) + soma;

                            var num = percentAd.toString().replace(".", ",");

                            var result = $(this).parent().find("input[id*='txtValoresBases']").val(num);                            
                        }
                    }


                });

            }


            function ShowIcon() {
                var e = document.getElementById("processing");
                e.style.visibility = (e.style.visibility == 'visible') ? 'hidden' : 'visible';
            }

            function CallServerServico() {
                document.getElementById('<%= btnFiltroNomeSupplier.ClientID %>').click();
            }

            function showAutoCloseMessage(MsgsExc) {
                showNotification({
                    message: MsgsExc,
                    autoClose: true,
                    type: "success",
                    duration: 8
                });
            }

        </script>

        <asp:ScriptManager ID="ScriptManager1" runat="server" />

        <div class="bgHeader">

            <div class="bgHeader_into">

                <asp:ImageButton ID="ImgVoltarMenu" runat="server" ImageUrl="~/images/Icones/iconeMenu2.png" OnClick="VoltarMenu" ToolTip="Menu" />

            </div>

            <div class="bgHeader_into_MontaServCons">

                <asp:Label ID="lblSupplierHeader" runat="server" Text="Montar Serviço" CssClass="titulo" />

            </div>

        </div>

        <div id="MServico">

            <div id="tabs">
                <ul>
                    <li><a href="#tabs-1">List</a></li>
                    <li><a href="#tabs-2">Cadastros</a></li>
                </ul>


                <div id="tabs-1">

                    <asp:UpdatePanel ID="UpdatePanelList" runat="server">
                        <ContentTemplate>

                            <script type="text/javascript">
                                Sys.Application.add_load(jScript);
                            </script>

                            <div class="forms">

                                <div class="MServicoFormEsq">
                                    <fieldset id="SetMServico">
                                        <legend>
                                            <h3 style="margin-bottom: 0px">Sub Serviço</h3>
                                        </legend>

                                        <div class="MServicoFormularioCrud radius">

                                            <div class="MServCadastro">

                                                <asp:TextBox ID="txtCodMServico" runat="server" Style="display: none;" />

                                                <p class="paragrafo">
                                                    <asp:Label ID="lblSupplierMServicoTXT" runat="server" Text="Supplier:"></asp:Label>
                                                    <br />
                                                    <asp:TextBox ID="txtSupplier" runat="server" placeholder="Informe o nome do supplier." Width="340px" MaxLength="50"></asp:TextBox>
                                                    <asp:RequiredFieldValidator ID="RqSupplier" runat="server"
                                                        ControlToValidate="txtSupplier" ErrorMessage="*"
                                                        Font-Size="Small" ToolTip="Campo requerido." ValidationGroup="Salvar"></asp:RequiredFieldValidator>

                                                    <asp:AutoCompleteExtender ID="AutoCompleteExtenderSupplier" runat="server" CompletionInterval="100" DelimiterCharacters="" EnableCaching="False" Enabled="True" MinimumPrefixLength="1" OnClientItemSelected="CallServerServico" ServiceMethod="SearchSuppliers" ServicePath="" TargetControlID="txtSupplier">
                                                    </asp:AutoCompleteExtender>

                                                    <asp:Button ID="btnFiltroNomeSupplier" Style="display: none" runat="server" OnClick="PreencheDataListBase" />
                                                </p>

                                                <div class="FromDatas">

                                                    <div class="dataFrom">
                                                        <asp:Label ID="lblFrom" runat="server" Text="Data From:"></asp:Label>
                                                        <br />
                                                        <asp:TextBox ID="from" runat="server" Width="100px" MaxLength="10" onkeypress="teste()"></asp:TextBox>
                                                        <asp:RequiredFieldValidator ID="RqDataFrom" runat="server"
                                                            ControlToValidate="from" ErrorMessage="*"
                                                            Font-Size="Small" ToolTip="Campo requerido." ValidationGroup="SalvarBases">*</asp:RequiredFieldValidator>
                                                    </div>

                                                    <div class="dataTo">
                                                        <asp:Label ID="lblTo" runat="server" Text="Data To:"></asp:Label><br />
                                                        <asp:TextBox ID="to" runat="server" Width="100px" MaxLength="10"></asp:TextBox>
                                                        <asp:RequiredFieldValidator ID="RqDataTo" runat="server"
                                                            ControlToValidate="to" ErrorMessage="*" Font-Size="Small"
                                                            ToolTip="Campo requerido." ValidationGroup="SalvarBases">*</asp:RequiredFieldValidator>
                                                    </div>

                                                </div>

                                                <asp:UpdatePanel ID="UpdatePanel2" runat="server">
                                                    <ContentTemplate>

                                                        <div class="FormTipoServico">

                                                            <div class="FormTipoServico_tiposervico">
                                                                <asp:Label ID="lblItemSubServicoMServicoTXT" runat="server" Text="Item:"></asp:Label><br />
                                                                <asp:DropDownList ID="ddlItemSubServico" runat="server">
                                                                </asp:DropDownList>
                                                            </div>

                                                            <div class="FormTipoServico_categoria">
                                                                <asp:Label ID="lblSubItemTXT" runat="server" Text="Sub Tipo:"></asp:Label><br />
                                                                <asp:DropDownList ID="ddlSubItemSubServico" runat="server">
                                                                </asp:DropDownList>
                                                            </div>

                                                        </div>

                                                    </ContentTemplate>
                                                </asp:UpdatePanel>

                                                <div class="FormMoeda_Obs">

                                                    <div class="FormMoeda_Obs_obs">
                                                        <asp:Label ID="lblObsMServicoTXT" runat="server" Text="Observação:"></asp:Label><br />
                                                        <asp:TextBox ID="txtObs" runat="server" TextMode="MultiLine" MaxLength="100" Width="348px" />
                                                    </div>

                                                </div>

                                                <p class="paragrafo">
                                                    <asp:Label ID="lblBasesIndex" runat="server" Text="Bases:" /><br />
                                                    <asp:RadioButtonList ID="rdoBasesIndex" runat="server" RepeatDirection="Horizontal" AutoPostBack="True" OnSelectedIndexChanged="rdoBasesIndex_SelectedIndexChanged">
                                                        <asp:ListItem Value="1" Selected="True" Text="Base Principal" />
                                                        <asp:ListItem Value="2" Text="Base 2" />
                                                        <asp:ListItem Value="3" Text="Base 3" />
                                                    </asp:RadioButtonList>
                                                </p>

                                            </div>

                                            <asp:Label ID="lblMsgCadMServicos" runat="server" CssClass="MsgErro"></asp:Label>

                                        </div>

                                    </fieldset>
                                </div>

                                <div class="MServicoFormDir">

                                    <fieldset style="margin-top: 2px; height: 500px;">
                                        <legend>Serviços por supplier</legend>

                                        <asp:Panel ID="PanelDataLists" Visible="False" runat="server" Width="835px" Height="496px">

                                            <div class="GridMServico_Filtro">

                                                <div class="bases_filtros">

                                                    <div class="bases_filtros_drops">
                                                        <asp:Label ID="lblMercadoFiltro_BaseTXT" runat="server" Text="Mercado:" /><br />
                                                        <asp:DropDownList ID="ddlMercadoFiltro_Base" AutoPostBack="True" runat="server" OnSelectedIndexChanged="ddlMercadoFiltro_Base_SelectedIndexChanged"></asp:DropDownList>
                                                    </div>

                                                    <div class="bases_filtros_drops">
                                                        <asp:Label ID="lblBaseTarifariaFiltro_BaseTXT" runat="server" Text="Base Tarifária:" /><br />
                                                        <asp:DropDownList ID="ddlBaseTarifariaFiltro_Base" AutoPostBack="True" runat="server" OnSelectedIndexChanged="ddlBaseTarifariaFiltro_Base_SelectedIndexChanged"></asp:DropDownList>
                                                    </div>

                                                    <div class="bases_filtros_drops">
                                                        <asp:Label ID="lblTipoBase_Base" runat="server" Text="Tipo de Base:" /><br />
                                                        <asp:DropDownList ID="ddlTipoBase_Base" AutoPostBack="True" runat="server" OnSelectedIndexChanged="ddlTipoBase_Base_SelectedIndexChanged"></asp:DropDownList>
                                                    </div>

                                                    <div class="bases_filtros_drops">
                                                        <asp:Label ID="lblMoedaFiltro_BaseTXT" runat="server" Text="Moeda:" /><br />
                                                        <asp:DropDownList ID="ddlMoedaFiltro_Base" AutoPostBack="True" runat="server" OnSelectedIndexChanged="ddlMoedaFiltro_Base_SelectedIndexChanged"></asp:DropDownList>
                                                    </div>

                                                    <div class="bases_filtros_box_dividir">

                                                        <div class="bases_filtros_drops_dividir">
                                                            <asp:Label ID="lblDividirBulk" runat="server" Text="Dividir: " />
                                                            <asp:RadioButtonList ID="RdoDividir" runat="server" RepeatDirection="Horizontal" Width="108px">
                                                                <asp:ListItem Value="S" Text="Sim" Selected="True" />
                                                                <asp:ListItem Value="N" Text="Não" />
                                                            </asp:RadioButtonList>
                                                        </div>
                                                        <div class="bases_filtros_drops_dividir">
                                                            <asp:Label ID="lblDeDividir" runat="server" Text="De: " />
                                                            <asp:TextBox ID="txtDeDividir" runat="server" Width="30px" />
                                                        </div>
                                                        <div class="bases_filtros_drops_dividir">
                                                            <asp:Label ID="lblParaDividir" runat="server" Text="Para: " />
                                                            <asp:TextBox ID="txtParaDividir" runat="server" Width="30px" />
                                                        </div>
                                                        <div class="bases_filtros_drops_dividir">
                                                            <asp:Label ID="lblValorDividir" runat="server" Text="Valor: " />
                                                            <asp:TextBox ID="txtValorDividir" runat="server" Width="70px" />
                                                        </div>

                                                        <asp:Button ID="btnCopiarDividir" runat="server" Text="Copiar" OnClick="btnCopiarDividir_Click" />

                                                    </div>

                                                    <div class="bases_filtros_box">

                                                        <asp:Button ID="btnSalvarTarifas" runat="server" CssClass="btnGeralAzul" Text="Salvar" OnClick="SalvarTarifas" ValidationGroup="SalvarBases" />
                                                        <asp:Button ID="btnAtualizarTarifas" runat="server" CssClass="btnGeralAzul" Text="Atualizar" OnClick="AtualizarTarifas" Visible="False" ValidationGroup="SalvarBases" />


                                                        <asp:Label ID="lblPorcetagemTarifaTXT" runat="server" Text="Taxas:"></asp:Label>&nbsp
                                <asp:TextBox ID="txtPorcentagemTaxa" runat="server" Width="50px">0</asp:TextBox>
                                                        %&nbsp;&nbsp;&nbsp;
                                <asp:TextBox ID="txtPorcentagemImposto1" runat="server" Width="50px">0</asp:TextBox>% 
                                &nbsp;
                                <asp:Label ID="lblComissaoTXT" runat="server" Text="Comissão:"></asp:Label>&nbsp;
                                <asp:TextBox ID="txtComissao" runat="server" Width="50px" Text="0" />
                                                        %&nbsp;&nbsp;&nbsp;

                                                        <asp:ImageButton ID="OpenCalc" runat="server" ImageUrl="../../images/Icones/calc2S.png" ToolTip="Acréscimo/Decréscimo de valor e/ou percentual." />

                                                        <asp:Panel ID="PanelCalcSS" runat="server" CssClass="ModalPopup" Style="display: none; width: auto; height: auto; overflow-x: auto; overflow-y: auto; border-radius: 5px;">

                                                            <asp:ImageButton ID="btnImgFecharModalCalcSS" ToolTip="Fechar" runat="server" ImageUrl="../../images/Icones/close2.png" Width="20px" Height="20px" />

                                                            Valor:
                                                        <asp:TextBox ID="txtValorAdicional" runat="server" Text="0" Width="50px" />

                                                            Percent:
                                                        <asp:TextBox ID="txtPercentValorAdicional" runat="server" Text="0" Width="50px" />

                                                            <asp:CheckBox ID="chkPercentValorSS" runat="server" Text="Adicionar?" AutoPostBack="true" OnCheckedChanged="chkPercentValorSS_CheckedChanged" />
                                                        </asp:Panel>

                                                        <asp:ModalPopupExtender ID="ModalPopupExtenderAddCategoria" runat="server" BackgroundCssClass="ModalPopupBG" CancelControlID="btnImgFecharModalCalcSS"
                                                            DropShadow="false" Enabled="True" PopupControlID="PanelCalcSS" PopupDragHandleControlID="PopupHeader" RepositionMode="RepositionOnWindowResizeAndScroll"
                                                            Drag="true" TargetControlID="OpenCalc">
                                                        </asp:ModalPopupExtender>

                                                        <asp:ImageButton ID="btnImgAtualizarTaxas" ImageUrl="~/images/Icones/refresh-icon.png" ToolTip="Atualizar taxas." runat="server" OnClick="btnImgAtualizarTaxas_Click" />

                                                    </div>

                                                </div>

                                            </div>

                                            <div class="DataListBases">

                                                <asp:Label ID="lblBasesTXT" runat="server" Text="Base Escolhida" />
                                                <br />
                                                <br />

                                                <div class="DataListBasesInto">
                                                    <asp:DataList ID="DataListBases" runat="server" RepeatDirection="Horizontal" RepeatColumns="10">
                                                        <ItemTemplate>
                                                            <asp:Label ID="baseID" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "Base_id") %>' Style="display: none" />

                                                            <asp:Label ID="NomeTransporte" Font-Size="Small" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "Tipo_Transporte.TipoTrans_nome") %>' />
                                                            <br />
                                                            <asp:Label ID="baseDe" Font-Bold="true" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "Base_de") %>' />
                                                            -
                                                            <asp:Label ID="basePara" Font-Bold="true" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "Base_ate") %>' />
                                                            <br />
                                                            <asp:TextBox ID="txtValoresBases" runat="server" MaxLength="8" Width="50px" />
                                                            <%--<asp:RequiredFieldValidator ID="RqValorBases"
                                                                runat="server"
                                                                ErrorMessage="*"
                                                                ToolTip="Campo requerido."
                                                                ControlToValidate="txtValoresBases"
                                                                ValidationGroup="SalvarBases"
                                                                CssClass="MsgErro" />--%>&nbsp                                                               
                                                    <br />
                                                            <asp:Label ID="lblTotalBulk" Font-Bold="true" ForeColor="Red" runat="server" />
                                                            <asp:Label ID="lblIDValores" runat="server" Visible="false" />
                                                        </ItemTemplate>
                                                    </asp:DataList>
                                                </div>

                                                <br />

                                            </div>

                                        </asp:Panel>
                                    </fieldset>

                                </div>

                            </div>

                        </ContentTemplate>
                    </asp:UpdatePanel>
                </div>

                <div id="tabs-2">

                    <asp:UpdatePanel ID="UpdatePanelCadastros" runat="server">
                        <ContentTemplate>

                            <fieldset>
                                <legend>Serviços</legend>

                                <div class="FiltrosMServicos">

                                    <table>
                                        <tr>
                                            <td>
                                                <asp:Label ID="lblFiltroMServicosDataFrom" runat="server" Text="Data From:" />
                                            </td>
                                            <td>
                                                <asp:TextBox ID="txtFiltroMServicosDataFrom" runat="server" MaxLength="10" Width="100px" />
                                            </td>
                                            <td>
                                                <asp:Label ID="lblFiltroMServicosDataTo" runat="server" Text="Data From:" />
                                            </td>
                                            <td>
                                                <asp:TextBox ID="txtFiltroMServicosDataTo" runat="server" MaxLength="10" Width="100px" />
                                            </td>
                                            <td></td>
                                            <td>
                                                <asp:ImageButton ID="btnFiltroMServico" runat="server" ImageUrl="~/images/Icones/iconFilterPeq.png" OnClick="btnFiltroMServico_Click" />
                                            </td>
                                        </tr>
                                    </table>
                                    <table>
                                        <tr>
                                            <td>
                                                <asp:Label ID="lblFiltroMServicoItemSubServico" runat="server" Text="Item SubServiço:" />
                                            </td>
                                            <td>
                                                <asp:DropDownList ID="ddlFiltroMServicoItemSubServico" runat="server" />
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <asp:Label ID="lblFiltroMServicoSubItem" runat="server" Text="SubItem:" />
                                            </td>
                                            <td>
                                                <asp:DropDownList ID="ddlFiltroMServicoSubItem" runat="server" />
                                            </td>
                                        </tr>
                                    </table>

                                    <table>
                                        <tr>
                                            <td>
                                                <asp:RadioButtonList ID="rdoBasesIndexSubServico" runat="server" RepeatDirection="Horizontal" BorderStyle="None">
                                                    <asp:ListItem Value="1" Selected="True" Text="Base Principal" />
                                                    <asp:ListItem Value="2" Text="Base 2" />
                                                    <asp:ListItem Value="3" Text="Base 3" />
                                                </asp:RadioButtonList>
                                            </td>
                                        </tr>
                                    </table>

                                </div>

                                <div class="GridMServico">

                                    <asp:GridView ID="GridMServicos" runat="server"
                                        AutoGenerateColumns="False" GridLines="None" CssClass="mGrid" EmptyDataText="Não existe Serviços para esse Supplier."
                                        Height="16px"
                                        Width="94px">
                                        <AlternatingRowStyle CssClass="alt"></AlternatingRowStyle>
                                        <Columns>

                                            <asp:BoundField DataField="IdMServico" HeaderText="ID" ReadOnly="True"
                                                SortExpression="IdMServico" InsertVisible="False">
                                                <FooterStyle CssClass="invisible" />
                                                <HeaderStyle CssClass="invisible" />
                                                <ItemStyle CssClass="invisible" />
                                            </asp:BoundField>

                                            <asp:BoundField DataField="MServico_DataFrom" HeaderText="Data To" DataFormatString="{0:dd/MM/yyyy}" />

                                            <asp:BoundField DataField="MServico_DataTo" HeaderText="Data To" DataFormatString="{0:dd/MM/yyyy}" />

                                            <asp:BoundField DataField="ItemSubServico" HeaderText="Item SubServiço">

                                                <HeaderStyle Wrap="False" />
                                                <ItemStyle Wrap="False" />
                                            </asp:BoundField>

                                            <asp:BoundField DataField="SubItem" HeaderText="Sub Item">

                                                <HeaderStyle Wrap="False" />
                                                <ItemStyle Wrap="False" />
                                            </asp:BoundField>

                                            <asp:BoundField DataField="MServico_Obs" HeaderText="Obs" />

                                            <asp:BoundField DataField="Base_index" HeaderText="Base Index">
                                                <HeaderStyle Wrap="False" />
                                                <ItemStyle Wrap="False" HorizontalAlign="Center" />
                                            </asp:BoundField>

                                            <asp:TemplateField>
                                                <ItemTemplate>
                                                    <asp:ImageButton ID="EditarMServico" ToolTip="Editar Serviço"
                                                        runat="server" ImageUrl="~/images/Icones/edit.png"
                                                        CommandArgument='<%# Eval("IdMServico") %>'
                                                        OnCommand="EditarMServico" />
                                                </ItemTemplate>
                                                <HeaderStyle Wrap="False" />
                                                <ItemStyle Wrap="False" />
                                            </asp:TemplateField>

                                            <asp:TemplateField>
                                                <ItemTemplate>
                                                    <asp:ImageButton ID="ExluirMServico" ToolTip="Excluir Serviço"
                                                        runat="server" CommandArgument='<%# Eval("IdMServico") %>'
                                                        OnCommand="ExcluirMServico" OnClientClick="return confirm('Excluindo esse serviço, todas as tarifas do mesmo também serão excluídas. Confirma?');"
                                                        ImageUrl="~/images/Icones/delete.png" />
                                                </ItemTemplate>
                                                <HeaderStyle Wrap="False" />
                                                <ItemStyle Wrap="False" />
                                            </asp:TemplateField>


                                        </Columns>

                                        <PagerStyle CssClass="pgr"></PagerStyle>

                                    </asp:GridView>

                                </div>
                            </fieldset>

                        </ContentTemplate>
                    </asp:UpdatePanel>
                </div>

            </div>

        </div>
    </form>
</body>
</html>
